﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NLite.Domain.Cfg;
using NLite.Cfg;

namespace NLite.Domain.Wcf
{
    public static class WcfConfigurationExtensions
    {
        public static void ConfigServer(this Configuration extensionManager)
        {
            extensionManager.Add<MiniContainerConfigurationItem>();
            extensionManager.Add<MessageBusConfigurationItem>();

            NdfConfigurationItem sem = new NdfConfigurationItem();
            sem.Add<Cfg.ServerServiceDispatcherConfigurationItem>();
            extensionManager.Add(sem);

        }

        public static void ConfigClient(this Configuration extensionManager, string address, System.ServiceModel.Channels.Binding binding)
        {
            extensionManager.Add<MiniContainerConfigurationItem>();
            extensionManager.Add<MessageBusConfigurationItem>();

            NdfConfigurationItem sem = new NdfConfigurationItem();
            sem.Add(new Cfg.ClientServiceDispatcherConfigurationItem(address, binding));
            extensionManager.Add(sem);

        }
    }
}
